<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>


<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
<script type="text/javascript"
	src="<%=basePath %>js/jquery-1.42.min.js"></script>
<link href="<%=basePath %>css/bootstrap.min.css"
	rel="stylesheet" type="text/css">
<link href="<%=basePath %>css/font-awesome.min.css"
	rel="stylesheet" type="text/css">
<link href="<%=basePath %>css/base.css"
	rel="stylesheet" type="text/css">
<link href="<%=basePath %>css/reg.css"
	rel="stylesheet" type="text/css">
<link rel="stylesheet"
	href="<%=basePath %>css/headbott.css"
	type="text/css" />
<link rel="stylesheet"
	href="<%=basePath %>css/ace.min.css"
	type="text/css" />
</head>

<body>
    <div class="panel panel-default">
        <div class="panel-body">
            <div class="panel-heading" align="center"><h1 class="sub-header h3">文件上传</h1></div>
               <hr>
               <%-- action="<%=basePath %>uploadflv/upload.action" --%>
            <form class="form-horizontal" id="upload" method="post" action="<%=basePath %>uploadflv/upload.action" enctype="multipart/form-data">
                <div class="form-group" align="center">
                    <div class="col-md-4 col-sm-4  col-xs-4 col-lg-4">文件上传
                        <input type="file" class="form-control" name="file" id="file"><br>
                        <!-- <input type="submit" value="上传"> -->
                       <button  onClick="file3()">上传视频</button>
                        <!-- <img alt="视频" src="http://localhost:8080/img/2.mp4"> -->
                    </div>
                </div>
            </form>
        </div>
    </div>
    
    <script>
		/* var form = new FormData(document.getElementById("upload")); */
		 function file(){
				
				$.ajax({
					url : "<%=basePath %>uploadflv/upload.action",
					method : "post",
					dataType: "json",
					data: $("#upload").serialize(),
					/* data : form,
					processData : false,
					contentType : false, */
					success: function(data) {
						alert("++++" + data.message);
					},
					error: function(){
						alert("上传视频失败!!!");
					}
				})
			}
	</script>
</body>
</html>
